/*
 * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package java.util;

/**
 * Marker interface used by <tt>List</tt> implementations to indicate that
 * they support fast (generally constant time) random access.  The primary
 * purpose of this interface is to allow generic algorithms to alter their
 * behavior to provide good performance when applied to either random or
 * sequential access lists.
 * 这是被List使用的Marker interface(标志接口)
 * 继承RandomAccess目的是为了提供快速的(常量级时间)随机访问。
 * 这个接口最主要的目的是允许通用性的算法在应用于随机或者顺序访问列表时候改变其行为,以提供良好的性能。
 *
 * <p>The best algorithms for manipulating random access lists (such as
 * <tt>ArrayList</tt>) can produce quadratic behavior when applied to
 * sequential access lists (such as <tt>LinkedList</tt>).  Generic list
 * algorithms are encouraged to check whether the given list is an
 * <tt>instanceof</tt> this interface before applying an algorithm that would
 * provide poor performance if it were applied to a sequential access list,
 * and to alter their behavior if necessary to guarantee acceptable
 * performance.
 * 操作随机访问列表的最佳算法(例如ArrayList),当应用于顺序访问列表的时候(顺序访问),可能会产生平二次行为
 * 我们鼓励通用List算法去检查一下给定的list的时候是否为RandomAccess接口的实例,如果将该算法应用在顺序访问列表,则该算法会提供一个较差的性能。
 * 我们应该在有需要的时候修改它的行为,去保证一个可以接受的性能。
 *
 * <p>It is recognized that the distinction between random and sequential
 * access is often fuzzy.  For example, some <tt>List</tt> implementations
 * provide asymptotically linear access times if they get huge, but constant
 * access times in practice.  Such a <tt>List</tt> implementation
 * should generally implement this interface.  As a rule of thumb, a
 * <tt>List</tt> implementation should implement this interface if,
 * 人们意识到,随机存储和顺序存储之间区别通常是模糊的。
 * 例如,一些List实现在数据量大的时候提供了渐进的(asymptotically)线性访问时间O(n),但在实践中,访问实践是恒定的O(1)。
 * 例如List实现应该继承这个RandomAccess接口
 *
 * 经典类的实例,下面的循环
 * for typical instances of the class, this loop:
 * <pre>
 *     for (int i=0, n=list.size(); i &lt; n; i++)
 *         list.get(i);
 * </pre>
 * 会快过这个
 * runs faster than this loop:
 * <pre>
 *     for (Iterator i=list.iterator(); i.hasNext(); )
 *         i.next();
 * </pre>
 *
 * 文档
 * <p>This interface is a member of the
 * <a href="{@docRoot}/../technotes/guides/collections/index.html">
 * Java Collections Framework</a>.
 *
 * 1.4出现随机访问的接口
 * @since 1.4
 */

/**
 * RandomAccess是一个标志结构,表明实现这个接口的集合类是支持快速随机访问的。
 */
public interface RandomAccess {
}
